cls
set JPDA_OPTS=-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n
rem set JAVA_OPTS=-Xms128m -Xmx128m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Dhttp.proxyHost=192.168.203.2 -Dhttp.proxyPort=8080

:check_for_rebuild
if ""%1"" == ""/r"" goto rebuild
if ""%2"" == ""/r"" goto debuild
goto :start

:rebuild
cd ..
call mvn clean
call mvn install -Dmaven.test.skip=true 
cd pimtool-web

:start
call %CATALINA_HOME%\bin\catalina.bat stop
call mvn cargo:undeploy cargo:deploy -Dmaven.test.skip=true 

call %CATALINA_HOME%\bin\catalina.bat jpda start

:end
